<!DOCTYPE html>
<!--
DOM 0 
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style type="text/css">
            .bgc{
                background: #f00;
                color: #fff;
            }
        </style>
        <script type="text/javascript" src="jquery/jquery-1.8.3.js"></script>
        <script type="text/javascript">
            $(function(){
                //此时的on的第二个参数没有设定
                //就认为对.ccc绑定
                //这显然就是模拟了bind
                //$(".ccc").on("click",runc);
                
                //当第二参数有值的时候 调用的对象就作为委派根对象
                $("#content").on("click",".ccc",runc);
               
                //以上模拟的是bind
                $("#content").append("<div class='ccc'>dddddd</div>");
                
                $("#abc").append("<div class='ccc'>dddddd</div>");
                
            });
            function runc(event) {
                alert($(this).html());
            }
        </script>
    </head>
    <body id="body">
        <div id="content">
            <div class="ccc">aaaaa</div>
        </div>
        <div id="abc"></div>
    </body>
</html>
